package io.chenhd.gateway.client;

import io.chenhd.gateway.cache.ContextCache;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.http.FullHttpResponse;

/**
 * Create by chenhd on 2021/8/21.
 */
public class NettyClientInboundHandler extends ChannelInboundHandlerAdapter {

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        FullHttpResponse response = (FullHttpResponse) msg;
        ContextCache.responseCache.put(ctx.channel(), response);
        ctx.channel().notifyAll();
    }

}
